//
//  WSMineCell.m
//  LANGirl
//
//  Created by 吴帅 on 16/3/28.
//
//

#import "WSMineCell.h"

@interface WSMineCell ()


@end

@implementation WSMineCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
        self.contentView.backgroundColor = [UIColor whiteColor];
    }
    
    return self;
}

- (void)createSubView {
    
    
    //主页的图片
    self.icoImage = [[UIImageView alloc]init];
    [self.contentView addSubview:self.icoImage];
    [self.icoImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.contentView).offset(30.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake((22.00)*AUTO_WIDTH, 22.00*AUTO_WIDTH));
        
    }];
    
    
    //我的主页
    self.titleLabel = [[UILabel alloc]init];
    self.titleLabel.font=[UIFont systemFontOfSize:14*AUTO_WIDTH];
    self.titleLabel.alpha=0.5;
    [self.contentView addSubview:_titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.icoImage.mas_right).offset(23.00*AUTO_WIDTH/2);
        make.height.mas_equalTo(26.00 * AUTO_WIDTH);
    }];

    
    UILabel *xiLine = [[UILabel alloc]init];
    xiLine.backgroundColor =[UIColor grayColor];
    [self.contentView addSubview:xiLine];
    xiLine.alpha = 0.2;
    [xiLine mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.bottom.equalTo(self.contentView);
        make.left.equalTo(self.contentView.mas_left).offset(0);
        make.right.equalTo(self.contentView.mas_right).offset(0);
        make.height.mas_equalTo(1);
    }];

}

- (void)setTitleStr:(NSString *)titleStr {

    if (_titleStr != titleStr) {
        _titleStr = titleStr;
        self.titleLabel.text = titleStr;
        if ([_titleStr isEqualToString:@"我的主页"]) {
            self.icoImage.image = [UIImage imageNamed:@"main_cell@2p"];
        } else {
            self.icoImage.image = [UIImage imageNamed:@"mine_money"];
        }
        if ([_titleStr isEqualToString:@"公司主页"]) {
            self.icoImage.image = [UIImage imageNamed:@"buMainL"];
        }
        if ([titleStr isEqualToString:@"发布活动"]) {
            self.icoImage.image = [UIImage imageNamed:@"main_cell@2p"];
        }
    }
}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
